﻿ <%--
 *  File:   VisitPlanDayTempletSummary.jsp
 *  Desc:	
 *
 *  Date		         Author		      Changes
 *  2009-11-4 17:36:21	  Kent		  Created
 *
 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
  //init param
  String privilegeCode = "H0256";
  String strTableName = "v_visitdayplanusrsummary";
  String strModuleName = "SFE";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.customtag.element.*"%>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%@ include file="/inc/Security.inc" %>
 <%@ include file="/inc/PreparePageBack.inc" %>
 <%@ include file="/inc/FrmDefault.inc" %>
<%--added by fekindai 2009/12/09 start--%>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%-- end --%>

<html>
<head>
<title>VisitPlanDayTempletSummary</title>
<PageFlow:CheckPageFlow pageName="p_visitdayplancontactsummary"/>
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/SumDiv.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript">
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "VisitPlanDayTempletSummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function page_new()
{
	var cform = document.cform;
	var orgid = cform.orgid.value;
	var contactid = cform.userid.value;
	self.location.href='VisitPlanDayTempletEditFrm.jsp?isnew=Y&contactid='+contactid+'&orgid='+orgid+'&<%= OvalTools.randomURL() %>';
	parent.downframesetid.cols="0,100%";
}
function page_edit()
{
	var cform = document.cform;
	var status = cform.status.value;
	var id = cform.visitplandaytempletid.value;
	var orgid = cform.orgid.value;
	var contactid = cform.userid.value;
	if(isEmpty(id) || id == -1) return;
	
	    self.location.href='VisitPlanDayTempletEditFrm.jsp?visitplandaytempletid='+id+'&contactid='+contactid+'&orgid='+orgid+'&<%= OvalTools.randomURL() %>';
	
	parent.downframesetid.cols="0,100%";
}
function page_info()
{
	var cform = document.cform;
    var id = cform.visitplandaytempletid.value;
	var orgid = cform.orgid.value;
	var contactid = cform.userid.value;
    self.location.href='VisitPlanDayTempletEditFrm.jsp?displayflag=view&&contactid='+contactid+'&orgid='+orgid+'&visitplandaytempletid='+id+"&<%= OvalTools.randomURL() %>";
}
function page_delete()
{
	var cform = document.cform;
	var id = cform.visitplandaytempletid.value;
	var status = cform.status.value;

	if(isEmpty(id) || id == -1) return;
	
	if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE") %>") )  return;
	cform.actionname.value="delete";
	isRunning = true;
    cform.submit();
}
function page_copy()
{
	var cform = document.cform;
	var id = cform.visitplandaytempletid.value;
	
	if(isEmpty(id) || id == -1) return;
	
	
	cform.actionname.value="copy";
	isRunning = true;
    cform.submit();
}
 function clickRow(obj,idx)
{
  var cform = document.cform;
  cform.radiorow[idx].checked=true;
  cform.visitplandaytempletid.value = eval('obj.all.visitplandaytempletid'+idx).value;
  cform.status.value = eval('obj.all.status'+idx).value;
}

</script>
</head>

<body style="overflow: auto;">
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
    <input type="hidden" name="pagename" value="p_visitdayplancontactsummary">
    <input type="hidden" name="actionname">
<custom:hidden name="userinfo" property="orgid" scope="session"/>
<custom:hidden name="userinfo" property="userid" scope="session"/>
<%--added by fekindai 2009/12/09 start--%>
<%@ include file="/inc/PageLocation.inc" %>
<%--end--%>

<table width="100%" cellspacing="0" border="0" cellpadding="0">
      <tr>
<%--  search criteria  --%>
      </tr>
      <tr>
        <td>
          <table width="100%" border="0" cellspacing="0">
            <%@ include file="/inc/SummarySearch.inc" %>
          </table>
        </td>
      </tr>
      <tr>
        <td>
          <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">

<%
    ArrayList titleTdArray = new ArrayList();
    titleTdArray.add(new TD("22","&nbsp;"));
    titleTdArray.add(new TitleTD("100","L_TempletCode","templetcode","SFE") );
    titleTdArray.add(new TitleTD("120","L_TempletName","templetname","SFE"));
    titleTdArray.add(new TitleTD("100","L_Salesmen","employeename","SFE"));
  //  titleTdArray.add(new TitleTD("80","L_TempletType","templettypename","SFE"));
    titleTdArray.add(new TitleTD("100","L_CreateDate","createdate"));
    titleTdArray.add(new TitleTD(null,"L_Description","description"));
    titleTdArray.add(new TitleTD("50","L_Status","statusname"));
    
    
 %>
    <custom:titletr styleClass="deepblue-left" tdArray="<%=titleTdArray%>" />


 <%
     ArrayList detailTdArray = new ArrayList();
     detailTdArray.add(new RadioTD());
     detailTdArray.add(new WriteTD("templetcode").addHyperlink("javascript:page_info();",null));
     
     detailTdArray.add(new WriteTD("templetname"));
     detailTdArray.add(new WriteTD("employeename"));
   //  detailTdArray.add(new WriteTD("templettypename"));
     detailTdArray.add(new WriteTD("createdate","date","dateformat"));
     detailTdArray.add(new WriteTD("description"));
     detailTdArray.add(new DicWriteTD("status","Status"));

     ArrayList hiddenArray = new ArrayList();
     hiddenArray.add(new HiddenInput("visitplandaytempletid",true));
     hiddenArray.add(new HiddenInput("status",true));
 %>
    <custom:iteratetr tdArray="<%=detailTdArray%>" hiddenArray="<%=hiddenArray%>"  dataSource="templetsummary"/>
            <%@ include file="/inc/SummaryAction.inc" %>

          </table>
          <table width="100%" cellspacing="0" cellpadding="0">
            <tr><td class="summary_top"></td></tr>
            <tr>
              <td class="td_center">
                <a onclick="page_new();"><custom:button type="1" label="L_New" imgsrc="new.gif" border="0" style="width:60"/></a>
                <%if(pageContext.getAttribute("templetsummary")!=null){%>
                <a onclick="page_edit();"><custom:button type="1" label="L_Edit" imgsrc="Modify.gif" border="0" style="width:60"/></a>
                <a onclick="page_delete();"><custom:button type="1" label="L_Delete" imgsrc="delete.gif" border="0" style="width:60"/></a>
                <!--a onclick="page_copy()"><custom:button type="1" label="L_Copy" imgsrc="Copy.gif" border="0" style="width:60"/></a-->
          
                <%}%>
              </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
</form>
</body>
<%--added by fekindai 2009/12/09 start--%>
<%--script>
	parent.downframesetid.cols="250,72%";
</script--%>
<%-- end --%>
</html>
